home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / MOVEDATA.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  492 b   |  18 lines

  1. /* movedata.c - moves specified number of bytes  */
  2. #include "stdio.h"
  3.  
  4. int movedata(to,from,nbytes)
  5.   char    *to   ;         /* move the data to here   */
  6.   char    *from ;         /* move it from here       */
  7.   int  nbytes ;         /* number of bytes to move */
  8.   {
  9.      while( nbytes > 0 )    /* stop when all bytes are moved */
  10.     { *to = *from  ;    /* move a byte */
  11.        to = to + 1 ;    /* advance pointers to and from */
  12.        from = from + 1 ;
  13.        nbytes = nbytes - 1 ;/* reduce bytes left */
  14.     }
  15.   }
  16.  
  17.  
  18.